package cn.edu.sdjzu.xg23.kcsj01_backend.controller;

import cn.edu.sdjzu.xg23.kcsj01_backend.entity.ApprovalDepartment;
import cn.edu.sdjzu.xg23.kcsj01_backend.service.impl.ApprovalDepartmentServiceImpl;
import cn.edu.sdjzu.xg23.kcsj01_backend.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ApprovalDepartmentController {

    @Autowired
    private ApprovalDepartmentServiceImpl approvalDepartmentService;

    @GetMapping("/approvalDepartment")
    public Result getAllApprovalDepartments() {
        List<ApprovalDepartment> departments = approvalDepartmentService.getAllApprovalDepartments();
        return Result.success(departments);
    }
}